import axios from '@/libs/api.request'
import qs from 'qs'

export const getTableData = (params) => {
  return axios.request({
    url: 'admins/monthlyTestRecordMtu/page?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}

export const findById = (params) => {
  return axios.request({
    url: 'admins/experimentRecord/findById?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const add = (data) => {
  return axios.request({
    url: 'admins/experimentRecord/addBatch',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const update = (data) => {
  return axios.request({
    url: 'admins/monthlyTestRecordMtu/update',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const del = (data) => {
  return axios.request({
    url: 'admins/monthlyTestRecordMtu/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}

// 试验缺陷
export const findQX = (params) => {
  return axios.request({
    url: 'admins/experimentRecordDefect/findByExperimentRecord?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const delQX = (data) => {
  return axios.request({
    url: 'admins/experimentRecordDefect/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}
// 试验缺陷参数
export const findCS = (params) => {
  return axios.request({
    url: 'admins/experimentRecordParam/findByExperimentRecord?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const delCS = (data) => {
  return axios.request({
    url: 'admins/experimentRecordParam/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}
// 图表-获取所有试验记录
export const getEchart = (params) => {
  return axios.request({
    // url: 'admins/experimentRecord/getAll?t='+new Date().getTime(),
    url: 'admins/monthlyTestRecordMtu/getListMonthChart?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}

// 导出
export const downExcel = (params) => {
  return axios.request({
    url: 'admins/monthlyTestRecordMtu/download?t=' + new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}

// 创建新增

export const monthlyTestRecordMtu = (data) => {
  return axios.request({
    url: 'admins/monthlyTestRecordMtu/add',
    data: qs.stringify(data),
    method: 'post'
  })
}

// UD45
export const getTableData2 = (params) => {
  return axios.request({
    url: 'admins/monthlyTestRecordUd45/page?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const add2 = (data) => {
  return axios.request({
    url: 'admins/monthlyTestRecordUd45/add',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const update2 = (data) => {
  return axios.request({
    url: 'admins/monthlyTestRecordUd45/update',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const del2 = (data) => {
  return axios.request({
    url: 'admins/monthlyTestRecordUd45/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}
export const downExcel2 = (params) => {
  return axios.request({
    url: 'admins/monthlyTestRecordUd45/download?t=' + new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
// 图表-获取所有试验记录
export const getEchart2 = (params) => {
  return axios.request({
    // url: 'admins/experimentRecord/getAll?t='+new Date().getTime(),
    url: 'admins/monthlyTestRecordUd45/getListMonthChart?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}

// LSH热备用
export const getTableData3 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsHotBack/page?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const add3 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsHotBack/add',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const update3 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsHotBack/update',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const del3 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsHotBack/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}
export const downExcel3 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsHotBack/download?t=' + new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
// 图表-获取所有试验记录
export const getEchart3 = (params) => {
  return axios.request({
    // url: 'admins/experimentRecord/getAll?t='+new Date().getTime(),
    url: 'admins/requalificationTestRecordLhsHotBack/getListMonthChart?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
// LSH运行
export const getTableData4 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsRunning/page?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const add4 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsRunning/add',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const update4 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsRunning/update',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const del4 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsRunning/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const downExcel4 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordLhsRunning/download?t=' + new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
// 图表-获取所有试验记录
export const getEchart4 = (params) => {
  return axios.request({
    // url: 'admins/experimentRecord/getAll?t='+new Date().getTime(),
    url: 'admins/requalificationTestRecordLhsRunning/getListMonthChart?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
// MTU试验记录
export const getTableData5 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordMtu/page?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const add5 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordMtu/add',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const update5 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordMtu/update',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const del5 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordMtu/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}
export const downExcel5 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordMtu/download?t=' + new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
// 图表-获取所有试验记录
export const getEchart5 = (params) => {
  return axios.request({
    // url: 'admins/experimentRecord/getAll?t='+new Date().getTime(),
    url: 'admins/requalificationTestRecordMtu/getListMonthChart?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}

// 最后一个
export const getTableData6 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordUd45/page?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
export const add6 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordUd45/add',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const update6 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordUd45/update',
    data: qs.stringify(data),
    method: 'post'
  })
}

export const del6 = (data) => {
  return axios.request({
    url: 'admins/requalificationTestRecordUd45/delete',
    data: qs.stringify(data),
    method: 'post'
  })
}
export const downExcel6 = (params) => {
  return axios.request({
    url: 'admins/requalificationTestRecordUd45/download?t=' + new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
// 图表-获取所有试验记录
export const getEchart6 = (params) => {
  return axios.request({
    // url: 'admins/experimentRecord/getAll?t='+new Date().getTime(),
    url: 'admins/requalificationTestRecordUd45/getListMonthChart?t=' + new Date().getTime(),
    params,
    method: 'get'
  })
}
